-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Watch configMap for deletion #12
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
helayoty
commented
Apr 5, 2023
•
edited
Loading
edited
- Set the patrol interval to ticker
- Check for configMap deletion event
Fei-Guo
reviewed
Apr 5, 2023
} | ||
|
||
retry.OnError(retry.DefaultBackoff, func(err error) bool { | ||
return true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will returning true
cause always retry?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. No specific error. We want to retry for all errors.
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
Signed-off-by: Heba Elayoty <hebaelayoty@gmail.com>
manual e2e run: helm install carbon-e2e --set apiServer.image.repository=helayoty/server --set carbonDataExporter.image.repository=helayoty/exporter --set carbonDataExporter.patrolInterval=15s --set apiServer.username=XXXXXX--set apiServer.password=YYYYY ./charts/carbon-intensity-exporter
NAME: carbon-e2e
LAST DEPLOYED: Wed Apr 5 07:13:45 2023
NAMESPACE: default
STATUS: deployed
REVISION: 1
TEST SUITE: None
+ kubectl wait --for=condition=available deploy carbon-e2e-carbon-intensity-exporter -n kube-system --timeout=300s
deployment.apps/carbon-e2e-carbon-intensity-exporter condition met
+ sleep 15
+ kubectl get configmap carbon-intensity -n kube-system
NAME DATA AGE
carbon-intensity 7 10s
+ kubectl describe configmap carbon-intensity -n kube-system
Name: carbon-intensity
Namespace: kube-system
Labels: <none>
Annotations: <none>
Data
====
message:
----
minForecast:
----
523.855390
numOfRecords:
----
288
forecastDateTime:
----
2023-04-05 14:15:00 +0000 UTC
lastHeartbeatTime:
----
2023-04-05 14:13:56.986976296 +0000 UTC m=+5.962670016
maxForecast:
----
578.662105
BinaryData
====
data: 29053 bytes
Events: <none>
+ sleep 10
+ kubectl delete configmap carbon-intensity -n kube-system
configmap "carbon-intensity" deleted
+ sleep 15
+ kubectl get configmap carbon-intensity -n kube-system
NAME DATA AGE
carbon-intensity 7 4s
+ kubectl describe configmap carbon-intensity -n kube-system
Name: carbon-intensity
Namespace: kube-system
Labels: <none>
Annotations: <none>
Data
====
forecastDateTime:
----
2023-04-05 14:15:00 +0000 UTC
lastHeartbeatTime:
----
2023-04-05 14:14:27.126788961 +0000 UTC m=+36.103318068
maxForecast:
----
578.662105
message:
----
minForecast:
----
523.855390
numOfRecords:
----
288
BinaryData
====
data: 29053 bytes
Events: <none>
+ sleep 5
+++ kubectl get pods -n kube-system -o=name
+++ grep carbon-e2e-carbon-intensity-exporter
+++ sed 's/^.\{4\}//'
++ echo carbon-e2e-carbon-intensity-exporter-778578866d-fgc7v
+ kubectl logs carbon-e2e-carbon-intensity-exporter-778578866d-fgc7v -c carbon-data-exporter -n kube-system
I0405 14:13:56.063652 1 options.go:108] Neither kubeconfig file nor control plane URL was specified. Falling back to in-cluster config.
I0405 14:13:56.064113 1 server.go:86] Inside server-> Run
I0405 14:13:56.064177 1 server.go:136] Inside server-> startExporter
I0405 14:13:56.064215 1 exporter.go:46] Inside exporter-> Run
I0405 14:13:56.064223 1 exporter.go:109] Inside exporter-> RefreshData
I0405 14:13:56.994834 1 configmap.go:69] configMap carbon-intensity has been created
I0405 14:14:11.997969 1 exporter.go:109] Inside exporter-> RefreshData
I0405 14:14:12.008032 1 configmap.go:103] configMap carbon-intensity has been deleted
I0405 14:14:12.147938 1 configmap.go:69] configMap carbon-intensity has been created
I0405 14:14:16.504308 1 exporter.go:109] Inside exporter-> RefreshData
I0405 14:14:16.658325 1 configmap.go:69] configMap carbon-intensity has been created
I0405 14:14:26.997542 1 exporter.go:109] Inside exporter-> RefreshData
I0405 14:14:27.008191 1 configmap.go:103] configMap carbon-intensity has been deleted
I0405 14:14:27.136142 1 configmap.go:69] configMap carbon-intensity has been created
|
Fei-Guo
approved these changes
Apr 5, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.